simon-5507-01-slides

Topics to be covered

  • What you will learn
    • About this course and your instructors
    • Where you can get SAS
    • Your first SAS program
    • History of SAS
    • Documentation header
    • Permanent storage
    • Saving your output
    • Getting data from a file

Overview

  • Introducing your instructor
  • Where you can get SAS
  • Your first SAS program
  • History of SAS
  • Directory structure and documentation header
  • Permanent storage
  • Saving your output
  • Getting data from a file

Course instructor, Steve Simon

Photo of Steve Simon

Course instructor, Suman Sahil

Insert image of Suman Sahil here.

Original developer, Mary Gerkovich

Photo of Mary Gerkovich

Github, https://github.com/pmean

Canvas site

Screenshot of Canvas site

Break #1

  • What you have learned
    • About this course and your instructors
  • What’s coming next
    • Where you can get SAS

Where can you get SAS

  • SAS OnDemand for Academics (SODA)
  • On your UMKC computer
    • Desktop, hard-wired to UMKC network
    • No laptops, no home computers
  • UMKC Student labs
    • Royall Hall 303, Lab #17 and #38
  • UMKC Remote Labs
  • Alternatives not covered in this class
    • SAS University
    • Jupyter lab
    • SASMarkdown. StatWeave

Alternative places where you can get SAS

  • SAS University
  • Jupyter lab
  • SASMarkdown. StatWeave

SAS on your UMKC computer

Screenshot of UMKC IS page on SAS software

UMKC Remote Labs

UMKC Remote Labs home page

SODA login page

Screenshot of SODA login page

SODA create profile (1 of 2)

Screenshot of First Time Visitor dialog box

SODA create profile (2 of 2)

Screenshot of First Time Visitor dialog box

SODA dashboard (1 of 2)

Screenshot of SODA dashboard

SODA enrollments

Screenshot of SODA enrollments page

SODA dashboard (2 of 2)

Screenshot of SODA dashboard

SODA studio (1 of 3)

Screenshot of SODA dashboard

SODA studio (2 of 3)

Screenshot of SODA dashboard

SODA studio (3 of 3)

Screenshot of SODA dashboard

Directory structure

  • One directory for the entire class
    • Possibly one directory for each module
  • Subdirectory structure
    • src
    • results
    • data
    • others?
      • images
      • doc

Break #2

  • What you have learned
    • Where you can get SAS
  • What’s coming next
    • Your first SAS program

SAS program editor

Program editor window with simple SAS program

SAS Test program (1 of 2)

data small_example;
  input x y;
  datalines;
1 2
2 4
3 6
;

SAS Test program (2 of 2)

proc print
    data=small_example(obs=1);
  title "First row of data";
run;

SAS results window (1 of 2)

Screenshot of results window

SAS log window (1 of 4)

Screenshot of log window

SAS log window (2 of 4)

Screenshot of log window

SAS log window (3 of 4)

1    data test_example;
2     input x y;
3     cards;

NOTE: The data set WORK.TEST_EXAMPLE has 3 observations and 2 variables.

Log messages (4 of 4)

 75         ;
 76         proc print
 77             data=small_example(obs=1);
 78         title "First row of data";
 79         run;
 
NOTE: There were 1 observations read from the data set WORK.SMALL_EXAMPLE.

Where is the output?

SAS has several options for storing output.

  • In the output window
  • As an html file
  • As a pdf file

Live demonstration (1 of 5)

Break #3

  • What you have learned
    • Your first SAS program
  • What’s coming next
    • History of SAS

History of SAS, blog post

Blog post on the history of SAS

Origins of SAS

  • SAS=Statistical Analysis System
  • Founders come from NCSU
    • Anthony Barr
    • James Goodnight
    • Jane Helwig
    • John Sall
  • Originally for IBM mainframes
    • PL/1, FORTRAN, Assembler
    • Translated to C in 1985

Corporate structure

  • SAS Institute
    • Founded 1976
    • Privately held
    • Huge spending on R&D
    • Great place to work

Licensing and training

  • SAS licensing model
    • Great for large organizations
    • Prohibitively expensive for individuals
  • Excellent training resources
    • SAS publications
    • Certification program
    • SAS user conferences

Other products from SAS Institute

  • JMP, 1989
  • Viya, 2017

Break #4

  • What you have learned
    • History of SAS
  • What’s coming next
    • Documentation header

Documentation header

* 5507-01-simon-documentation-header.sas
  author: Steve Simon
  date: created 2022-06-06
  purpose: to read and print a small dataset
  license: public domain;

Live demonstration (2 of 5)

Break #5

  • What you have learned
    • Documentation header
  • What’s coming next
    • Permanent storage

Permanent storage (1 of 4)

* 5507-01-simon-permanent-storage.sas
  author: Steve Simon
  date: created 2022-06-06
  purpose: to read and print a small dataset
  license: public domain;

Permanent storage (2 of 4)

libname perm "q:/introduction-to-sas/data";

Permanent storage (3 of 4)

data perm.small_example;
 input x y;
 datalines;
1 2
2 4
3 6
;

Permanent storage (4 of 4)

proc print
    data=perm.small_example(obs=1);
title "First row of data";
run;

Re-using data in permanent storage, part 1

* 5507-01-simon-re-use.sas
  author: Steve Simon
  date: created 2022-06-06
  purpose: calculate descriptive statistics 
    for strored data
  license: public domain;

Re-using data in permanent storage, part 2

libname perm "q:/introduction-to-sas/data";

proc means
    data=perm.simple_example;
  title1 "Descriptive statistics";
run;

Live demonstration (3 of 5)

Break #6

  • What you have learned
    • Permanent storage
  • What’s coming next
    • Saving your output

Saving output as pdf (1 of 4)

* 5507-01-simon-save-output-data.sas
  author: Steve Simon
  date: created 2022-06-06
  purpose: to read a small dataset
    from a separate file
  license: public domain;

Saving output as pdf (2 of 4)

libname perm "q:/introduction-to-sas/data";

ods pdf file=
    "q:/introduction-to-sas/results/5507-01-simon-save-output.pdf";

Saving output as pdf (3 of 4)

data perm.small_example;
 input x y;
 datalines;
1 2
2 4
3 6
;

Saving output as pdf (4 of 4)

proc print
    data=perm.small_example(obs=1);
title "First row of data";
run;

ods pdf close;

Live demonstration (4 of 5)

Break #7

  • What you have learned
    • Saving your output
  • What’s coming next
    • Getting data from a file

Reading data from a file (1 of 4)

* 5507-01-simon-read-data.sas
  author: Steve Simon
  date: created 2022-06-09
  purpose: to read a small dataset
    from a separate file
  license: public domain;

Reading data from a file (2 of 4)

libname perm "q:/introduction-to-sas/data";

filename rawdata
  "q:/introduction-to-sas/data/six-numbers.txt";

ods pdf file=

Reading data from a file (3 of 4)

data perm.small_example;
 infile rawdata;
 input x y;
run;

Reading data from a file (4 of 4)

proc print
    data=perm.small_example(obs=1);
title "First row of data";
run;

ods pdf close;

Reading data from a file, part 4

1 2
2 4
3 6

Live demonstration (5 of 5)

Summary

  • What you have learned
    • About this course and your instructors
    • Where you can get SAS
    • Your first SAS program
    • History of SAS
    • Documentation header
    • Permanent storage
    • Saving your output
    • Getting data from a file